<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>spaceship.AGSprite</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="spaceship-module.html">Module&nbsp;spaceship</a> ::
        Class&nbsp;AGSprite
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="spaceship.AGSprite-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class AGSprite</h1><span class="codelink"><a href="spaceship-pysrc.html#AGSprite">source&nbsp;code</a></span><br /><br />
<pre class="base-tree">
       <a href="base.AGObject-class.html">base.AGObject</a> --+
                       |
          object --+   |
                   |   |
pygame.sprite.Sprite --+
                       |
                      <strong class="uidshort">AGSprite</strong>
</pre>

<dl><dt>Known Subclasses:</dt>
<dd>
    <a href="spaceship.Destructible-class.html">Destructible</a>,
    <a href="spaceship.AmmoConsumingItem-class.html">AmmoConsumingItem</a>,
    <a href="spaceship.Projectile-class.html">Projectile</a>,
    <a href="spaceship.Shield-class.html">Shield</a>,
    <a href="spaceship.InstantEnergyBeam-class.html">InstantEnergyBeam</a>,
    <a href="spaceship.Explosion-class.html">Explosion</a>,
    <a href="spaceship.Bonus-class.html">Bonus</a>
</dd></dl>

<hr />
Abstract sprite class used as a parent class for more specific classes
  like Ship, Projectile or Obstacle.<br /><br />

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.AGSprite-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">pos</span>,
        <span class="summary-sig-arg">*groups</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="set_mover"></a><span class="summary-sig-name">set_mover</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">mover</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite.set_mover">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.AGSprite-class.html#is_offscreen" class="summary-sig-name">is_offscreen</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Return <code>True</code> if object is completely offscreen or 
      <code>False</code> otherwise.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite.is_offscreen">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.AGSprite-class.html#_check_cfg" class="summary-sig-name">_check_cfg</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">required_props</span>)</span><br />
      Auxiliary function that may be used to check if object's 
      <code>cfg</code> attribute contains information on required 
      properties.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite._check_cfg">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.AGSprite-class.html#_check_gfx" class="summary-sig-name">_check_gfx</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">required_resources</span>)</span><br />
      Auxiliary function that may be used to check if object's 
      <code>gfx</code> attribute contains required graphics resources.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite._check_gfx">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.AGSprite-class.html#_state_area" class="summary-sig-name">_state_area</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">image</span>,
        <span class="summary-sig-arg">state</span>)</span><br />
      Return <code>AGRect</code> containing information on position and 
      area of graphic resource representing selected state.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite._state_area">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.AGSprite-class.html#_blit_state" class="summary-sig-name">_blit_state</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">image</span>,
        <span class="summary-sig-arg">state</span>,
        <span class="summary-sig-arg">pos</span>=<span class="summary-sig-default"><code class="variable-group">(</code>0<code class="variable-op">, </code>0<code class="variable-group">)</code></span>)</span><br />
      Blit selected image state aquired from GfxManager on image 
      representing current instance</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite._blit_state">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.AGSprite-class.html#_init_animation" class="summary-sig-name">_init_animation</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">res</span>,
        <span class="summary-sig-arg">period</span>,
        <span class="summary-sig-arg">pos</span>=<span class="summary-sig-default"><code class="variable-group">(</code>0<code class="variable-op">, </code>0<code class="variable-group">)</code></span>,
        <span class="summary-sig-arg">align</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">center</code><code class="variable-quote">'</code></span>)</span><br />
      Initialize animation of resource <code>res</code> on object's 
      overlay.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite._init_animation">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="_update_animations"></a><span class="summary-sig-name">_update_animations</span>(<span class="summary-sig-arg">self</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite._update_animations">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.AGSprite-class.html#_initialize_position" class="summary-sig-name">_initialize_position</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">pos</span>,
        <span class="summary-sig-arg">align</span>,
        <span class="summary-sig-arg">size</span>)</span><br />
      Initializes object's <code>rect</code> attribute which is required
      by pygame to render object's image.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite._initialize_position">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.AGSprite-class.html#_update_position" class="summary-sig-name">_update_position</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Set new position of the object.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite._update_position">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.AGSprite-class.html#update" class="summary-sig-name">update</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Update position and animations.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite.update">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.AGSprite-class.html#kill" class="summary-sig-name">kill</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Emit signal and kill sprite.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite.kill">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.AGSprite-class.html#distance" class="summary-sig-name">distance</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">peer</span>)</span><br />
      Return distance (city) between self and peer.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite.distance">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.AGSprite-class.html#closest" class="summary-sig-name">closest</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">peers</span>)</span><br />
      Return object selected from <code>peers</code> closest to 
      <code>self</code>.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite.closest">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <div class="private">    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="base.AGObject-class.html">base.AGObject</a></code></b> (private):
      <code><a href="base.AGObject-class.html#_setattrs">_setattrs</a></code>
      </p></div>
    <p class="indent-wrapped-lines"><b>Inherited from <code>pygame.sprite.Sprite</code></b>:
      <code>__repr__</code>,
      <code>add</code>,
      <code>add_internal</code>,
      <code>alive</code>,
      <code>groups</code>,
      <code>remove</code>,
      <code>remove_internal</code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__setattr__</code>,
      <code>__str__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== STATIC METHODS ==================== -->
<a name="section-StaticMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Static Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-StaticMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.AGSprite-class.html#_closest_compare_dists" class="summary-sig-name">_closest_compare_dists</a>(<span class="summary-sig-arg">a</span>,
        <span class="summary-sig-arg">b</span>)</span><br />
      For dictionaries <code>a</code> and {b} return -1, 0, 1 depending 
      on values for <code>dict</code> keys.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#AGSprite._closest_compare_dists">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== INSTANCE VARIABLES ==================== -->
<a name="section-InstanceVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceVariables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">integer</span>
    </td><td class="summary">
        <a name="max_speed"></a><span class="summary-name">max_speed</span> = <code title="0">0</code><br />
      Maximal speed object can by moved with expressed in pixels per 
      second.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">int or None</span>
    </td><td class="summary">
        <a name="offscreen_lifetime"></a><span class="summary-name">offscreen_lifetime</span> = <code title="5000">5000</code><br />
      Maximum amount of time object can spend offscreen (may not apply 
      to some objects).
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">int</span>
    </td><td class="summary">
        <a name="offscreen_time"></a><span class="summary-name">offscreen_time</span> = <code title="0">0</code><br />
      Amount of time since object left screen last time.
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">sequence</span>
    </td><td class="summary">
        <a name="_animations"></a><span class="summary-name">_animations</span><br />
      Parameters of animations in progress.
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code><a href="base.Overlay-class.html" 
      class="link">Overlay</a></code></span>
    </td><td class="summary">
        <a name="_overlay"></a><span class="summary-name">_overlay</span><br />
      Object used to display auxiliary animations.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">string or tuple</span>
    </td><td class="summary">
        <a name="align"></a><span class="summary-name">align</span><br />
      Name or names of properties used to align object's 
      <code>rect</code> attribute.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">sequence</span>
    </td><td class="summary">
        <a name="center"></a><span class="summary-name">center</span><br />
      Current position of object's center in global coordinate 
      system.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">dict</span>
    </td><td class="summary">
        <a name="cfg"></a><span class="summary-name">cfg</span><br />
      Class configuration provided by <code><a 
      href="dbmanager.DBManager-class.html" 
      class="link">DBManager</a></code>.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">dict</span>
    </td><td class="summary">
        <a name="gfx"></a><span class="summary-name">gfx</span><br />
      The graphics resources provided by <code><a 
      href="gfxmanager.GfxManager-class.html" 
      class="link">GfxManager</a></code>.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">None or class derived from <code>Mover</code></span>
    </td><td class="summary">
        <a name="mover"></a><span class="summary-name">mover</span><br />
      Object responsible for controlling sprite movement.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">sequence</span>
    </td><td class="summary">
        <a name="pos"></a><span class="summary-name">pos</span><br />
      Current position of arbitrary object's point in global coordinate 
      system.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">sequence of two integers</span>
    </td><td class="summary">
        <a name="screen_size"></a><span class="summary-name">screen_size</span><br />
      Size of the screen in pixels.
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="base.AGObject-class.html">base.AGObject</a></code></b>:
      <code><a href="base.AGObject-class.html#clock">clock</a></code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Properties</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Properties"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">pos</span>,
        <span class="sig-arg">*groups</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#AGSprite.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>pos</code></strong> (pair of integers) - Initial position of the object. This pair defines the top-left
          corner of the object's rectangle <code>rect</code>.</li>
    </ul></dd>
    <dt>Overrides:
      <a href="base.AGObject-class.html#__init__">base.AGObject.__init__</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="is_offscreen"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">is_offscreen</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#AGSprite.is_offscreen">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Return <code>True</code> if object is completely offscreen or 
  <code>False</code> otherwise. Overlay does not count.
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="_check_cfg"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_check_cfg</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">required_props</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#AGSprite._check_cfg">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Auxiliary function that may be used to check if object's 
  <code>cfg</code> attribute contains information on required properties. 
  Properties with no default values defined on class level should always be
  checked.
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="_check_gfx"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_check_gfx</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">required_resources</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#AGSprite._check_gfx">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Auxiliary function that may be used to check if object's 
  <code>gfx</code> attribute contains required graphics resources. 
  Resources' states are not checked!
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="_state_area"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_state_area</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">image</span>,
        <span class="sig-arg">state</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#AGSprite._state_area">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Return <code>AGRect</code> containing information on position and area
  of graphic resource representing selected state.
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>image</code></strong> (string) - Name of graphic resource.</li>
        <li><strong class="pname"><code>state</code></strong> (string) - Name of state.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="_blit_state"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_blit_state</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">image</span>,
        <span class="sig-arg">state</span>,
        <span class="sig-arg">pos</span>=<span class="sig-default"><code class="variable-group">(</code>0<code class="variable-op">, </code>0<code class="variable-group">)</code></span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#AGSprite._blit_state">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Blit selected image state aquired from GfxManager on image 
  representing current instance
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>image</code></strong> (string) - Name of resource in object's <code>gfx</code> dictionary.</li>
        <li><strong class="pname"><code>state</code></strong> (string) - Name of resource's state.</li>
        <li><strong class="pname"><code>pos</code></strong> (sequence) - Position of upper-left corner of the image to be blit in 
          object's <code>image</code> coordinate space.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="_init_animation"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_init_animation</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">res</span>,
        <span class="sig-arg">period</span>,
        <span class="sig-arg">pos</span>=<span class="sig-default"><code class="variable-group">(</code>0<code class="variable-op">, </code>0<code class="variable-group">)</code></span>,
        <span class="sig-arg">align</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">center</code><code class="variable-quote">'</code></span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#AGSprite._init_animation">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Initialize animation of resource <code>res</code> on object's overlay.
  If object's overlay is not initialized, do it.
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>res</code></strong> (string) - Name of graphic resource contained by 
          <code>self.gfx</code></li>
        <li><strong class="pname"><code>period</code></strong> (float) - Animation time in seconds.</li>
        <li><strong class="pname"><code>pos</code></strong> (sequence) - Position of a point relative to which image drawn is aligned. 
          Point cooridinates itself must be relative to 
          <code>self.center</code>.</li>
        <li><strong class="pname"><code>align</code></strong> (string or sequence) - String or sequence used to align drawn images relative to 
          <code>pos</code> (as when aligning <code><a 
          href="base.AGRect-class.html" class="link">AGRect</a></code>.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="_initialize_position"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_initialize_position</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">pos</span>,
        <span class="sig-arg">align</span>,
        <span class="sig-arg">size</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#AGSprite._initialize_position">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Initializes object's <code>rect</code> attribute which is required by 
  pygame to render object's image. Also sets object's <code>pos</code> and 
  <code>align</code> attributes.
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>pos</code></strong> (tuple or list of two integers) - position of arbitrary object's point</li>
        <li><strong class="pname"><code>align</code></strong> (tuple or list of two strings) - names of properties used to align object's 
          <code>rect</code></li>
        <li><strong class="pname"><code>size</code></strong> (tuple) - object's size in pixels</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="_update_position"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_update_position</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#AGSprite._update_position">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Set new position of the object. New position is determined by object's
  <code>mover</code> if object has one. If not position is not changed. 
  Object's <code>align</code> attribute is used to properly align object's 
  <code>rect</code>.
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="update"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">update</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#AGSprite.update">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Update position and animations. Kill object if it is off the screen 
  for too long.
  <dl class="fields">
    <dt>Overrides:
      pygame.sprite.Sprite.update
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="kill"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">kill</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#AGSprite.kill">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Emit signal and kill sprite.
  <dl class="fields">
    <dt>Overrides:
      pygame.sprite.Sprite.kill
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="distance"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">distance</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">peer</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#AGSprite.distance">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Return distance (city) between self and peer.
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>peer</code></strong> (AGSprite) - </li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="_closest_compare_dists"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_closest_compare_dists</span>(<span class="sig-arg">a</span>,
        <span class="sig-arg">b</span>)</span>
    <br /><em class="fname">Static Method</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#AGSprite._closest_compare_dists">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  <p>For dictionaries <code>a</code> and {b} return -1, 0, 1 depending on 
  values for <code>dict</code> keys.</p>
  This method is used by <code>AGSprite.closest(peers)</code>.
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="closest"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">closest</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">peers</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#AGSprite.closest">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Return object selected from <code>peers</code> closest to 
  <code>self</code>. Return <code>None</code> if <code>peers</code> is 
  empty.
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>peers</code></strong> (sequence of <code><a href="spaceship.AGSprite-class.html" 
          class="link">AGSprite</a></code>s) - </li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0beta1 on Thu Jul 31 17:03:02 2008
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
